libxl: Fix domain soft reset state handling
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 18 Mar 2021 14:03:28 +0000 (15:03 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 18 Mar 2021 14:03:28 +0000 (15:03 +0100)
commitb0d7739f10dc93d9565220b4e79ebc6675548c02
tree609eaa31f863ea42f6f1b44ce5962f3e3e56e74b
parent1d6fa27b6b003e3589e6cae2b6d2fc3f842e0a6d
libxl: Fix domain soft reset state handling

In do_domain_soft_reset(), a `libxl__domain_suspend_state' is used
without been properly initialised and disposed of. This lead do a
abort() in libxl due to the `dsps.qmp' state been used before been
initialised:
    libxl__ev_qmp_send: Assertion `ev->state == qmp_state_disconnected || ev->state == qmp_state_connected' failed.

Once initialised, `dsps' also needs to be disposed of as the `qmp'
state might still be in the `Connected' state in the callback for
libxl__domain_suspend_device_model(). So this patch adds
libxl__domain_suspend_dispose() which can be called from the two
places where we need to dispose of `dsps'.

This is XSA-368.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Ian Jackson <iwj@xenproject.org>
Tested-by: Olaf Hering <olaf@aepfle.de>
master commit: dae3c3e8b257cd27d6b35a467a34bf79a6650340
master date: 2021-03-18 14:56:33 +0100
tools/libxl/libxl_create.c
tools/libxl/libxl_dom_suspend.c
tools/libxl/libxl_internal.h